<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="edge" />
    <meta content="elkan1788#gmail.com" name="author" />
    <link rel="shortcut icon" href="${base}/static/img/favicon.ico" />
    <title>爱康健维管理平台</title>

    <link href="${base}/static/vendor/easyui/themes/insdep/easyui.css" rel="stylesheet" type="text/css">
    <link href="${base}/static/vendor/easyui/themes/insdep/default_theme.css" rel="stylesheet" type="text/css">
    <link href="${base}/static/vendor/easyui/themes/insdep/easyui_plus.css" rel="stylesheet" type="text/css">
    <link href="${base}/static/vendor/easyui/themes/insdep/iconfont/iconfont.css" rel="stylesheet" type="text/css">
    <link href="${base}/static/vendor/easyui/themes/insdep/icon.css" rel="stylesheet" type="text/css">

    <style>
        .loadMask {
            width:100%;
            height:100%;
            background-color:#fff;
            filter:alpha(opacity=98);
            -moz-opacity:0.98;
            opacity:0.98;
            position:absolute;
            left:0px;
            top:0px;
            z-index:1000;
            text-align: center;
        }

        .loadMask img {
            position: absolute;
            z-index: 99999;
            top: 50%;
            left: 45%;
            width: 18px;
            height: 18px;
        }

        /* Form style */
        .label-top{ margin:0 0 10px; display:block;}
        .form-row { margin-bottom:20px }
        .form-row input { width:80% }
    </style>

    <script type="text/javascript" src="${base}/static/js/jquery.min.js"></script>
    <script type="text/javascript" src="${base}/static/vendor/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${base}/static/vendor/easyui/themes/insdep/jquery.insdep-extend.js"></script>
    <script type="text/javascript" src="${base}/static/js/utils.js"></script>
    <script type="text/javascript" src="${base}/static/vendor/easyui/plugin/fullcal/jquery.fullcalendar.min.js"></script>

    <script>
        $(function(){
            $('#master-layout').layout({
                fit:true
            });

            $.insdep.control('${base}/admin/default.do');

            $('#left_menu').tree({
                url: '${base}/static/js/left_menu.json',
                type: 'get',
                editable: false,
                lines: true,
                onClick: function(node){
                    if (node.url) {
                        $.insdep.control('${base}'+node.url);
                    }
                }
            });

            $('#left_menu').tree('expandAll');

            $('#exitSysItem').bind('click',function(){
                $('#exitConfirmDialog').dialog({
                    title: '提示',
                    iconCls: 'icon-tip',
                    modal: true
                });
            });

            $('#updateSysAdmin').bind('click', function(){
                $('#updateSysAdminDialog').dialog({
                    title: '更新账户信息',
                    iconCls: 'icon-tip',
                    modal: true
                });
            });
        });
    </script>
</head>

<body>
<div id="loadMask" class="loadMask">
    <img src="${base}/static/img/loading.gif" alt="加载中..."/>
</div>
<div id="master-layout">
    <div data-options="region:'north',border:false,bodyCls:'theme-header-layout'">
        <div class="theme-navigate">
            <div class="left">
                <a href="#" onclick="$.insdep.control('${base}/admin/default.do')" class="easyui-linkbutton">首页</a>
                <a href="#" onclick="$.insdep.control('${base}/admin/dashboard.do')" class="easyui-linkbutton">报表</a>
                <a href="#" onclick="$.insdep.control('${base}/admin/monitor.do?mt=sysinfo','',true)" class="easyui-linkbutton">系统监控</a>
                <a href="#" onclick="$.insdep.control('${base}/admin/monitor.do?mt=druid','',true)"  class="easyui-linkbutton">数据库监控</a>
            </div>
            <div class="right" style="color: #fff;">
                <div id="dateDiv" style="float:left;width:140px;padding:8px;cursor:hand">&nbsp;</div>
                <div style="float:left;width:100px;padding:8px;">您好：<b class="text-info">${admin.nickName}</b>!</div>
                <a href="#" class="easyui-menubutton theme-navigate-more-button" data-options="menu:'#more',hasDownArrow:false"></a>
                <div id="more" class="theme-navigate-more-panel">
                    <div id="updateSysAdmin" data-options="iconCls:'icon-man'">更新信息</div>
                    <div id="exitSysItem" data-options="iconCls:'icon-cancel'">退出</div>
                </div>
            </div>
        </div>
    </div>
    <div data-options="region:'west',split:true,border:false,iconCls:'icon-directory'" title="导航栏" style="width:200px; padding:10px 20px;">
        <ul id="left_menu" class="easyui-tree">

        </ul>
    </div>
    <div data-options="region:'center',border:false" title=" ">
        <div class="easyui-panel" id="control" data-options="fit:true,border:false" style="margin:0;padding:0;border:0; background:#fff;overflow-y: hidden">

        </div>
    </div>
</div>
<div id="exitConfirmDialog" style="display:none;padding:8px;" data-options="
                width: 320,
                buttons: [{
                    text:'确定',
                    iconCls:'icon-ok',
                    handler:function(){
                        location.href = '${base}/admin/logout.do';
                    }
                },{
                    text:'取消',
                    iconCls: 'icon-no',
                    handler:function(){
                        $('#exitConfirmDialog').dialog('close');
                    }
                }]
                            ">
    <div class="alert-warning">
        <div class="alert-icons"></div>
        <b>Warning!</b> 你确定要退出吗？
    </div>
</div>

<div id="updateSysAdminDialog" style="display:none;padding:8px;" data-options="
                width: 420,
                buttons: [{
                    text:'确定',
                    iconCls:'icon-ok',
                    handler:function(){
                        submitFrm('sysAdminFrm','更新个人信息')
                    }
                },{
                    text:'取消',
                    iconCls: 'icon-no',
                    handler:function(){
                        $('#updateSysAdminDialog').dialog('close');
                    }
                }]">
    <div class="easyui-panel" title="" style="width:100%;padding:0px 10px;border:1px solid #f0ad4e">
        <form id="sysAdminFrm" method="POST" action="${base}/admin/updateAdminInfo.do">
            <input name="adminId" value="${admin.adminId}" type="hidden"/>
            <div class="group-label">
                <p style="margin: 30px 2px;">
                    <input id="nickName" name="nickName" class="easyui-textbox" data-options="label:'昵称：'" style="width:100%;" value="${admin.nickName}">
                </p>
                <p style="margin: 30px 2px;">
                    <input id="email" name="email" class="easyui-textbox" data-options="label:'电子邮箱：'" style="width:100%;" value="${admin.email}">
                </p>
                <p style="margin: 0px 2px;">
                    <input id="passwd" name="passwd" class="easyui-passwordbox" data-options="prompt:'请输入新口令',label:'新口令：'" style="width:100%;">
                </p>
                <p style="margin: 30px 2px;">
                    <input id="repasswd" class="easyui-passwordbox" data-options="prompt:'确认口令',label:'确认口令：'" validType="confirmPass['#passwd']" style="width:100%;">
                </p>
            </div>
        </form>
    </div>
</div>
<div id="calendarDg" class="easyui-dialog"  style="width:760px;height:520px;" data-options="title:'万年历',iconCls:'icon-china-calendar',closed:true,modal:true">
    <div class="easyui-fullCalendar" fit="true"></div>
</div>
</body>
<script>
    $(function(){
        tick();

        $('#loadMask').fadeOut();

        $('#dateDiv').bind('click', function () {
            $('#calendarDg').dialog('open');
        })
    });

    $.extend($.fn.validatebox.defaults.rules, {
        confirmPass: {
            validator: function(value, param){
                var pass = $(param[0]).passwordbox('getValue');
                return value == pass;
            },
            message: '两次输入的密码不一致.'
        }
    });


    function showLocale(objD){
        var str,colorHead,colorFoot;
        var yy = objD.getYear();
        if(yy<1900) yy = yy+1900;
        var MM = objD.getMonth()+1;
        if(MM<10) MM = '0' + MM;
        var dd = objD.getDate();
        if(dd<10) dd = '0' + dd;
        var hh = objD.getHours();
        if(hh<10) hh = '0' + hh;
        var mm = objD.getMinutes();
        if(mm<10) mm = '0' + mm;
        var ss = objD.getSeconds();
        if(ss<10) ss = '0' + ss;
        var ww = objD.getDay();
        if  ( ww==0 )  colorHead="<font class=\"up-font-over\">";
        if  ( ww > 0 && ww < 6 )  colorHead="<font class=\"up-fonts\">";
        if  ( ww==6 )  colorHead="<font class=\"up-font-over\">";
        if  (ww==0)  ww="星期日";
        if  (ww==1)  ww="星期一";
        if  (ww==2)  ww="星期二";
        if  (ww==3)  ww="星期三";
        if  (ww==4)  ww="星期四";
        if  (ww==5)  ww="星期五";
        if  (ww==6)  ww="星期六";
        colorFoot="</font>"
        str = colorHead + yy + "年" + MM + "月" + dd + "日  " + ww + colorFoot;
        return(str);
    }

    function tick(){
        var today;
        today = new Date();
        document.getElementById("dateDiv").innerHTML = showLocale(today);
        window.setTimeout("tick()", 1000);
    }

</script>
</html>

